package com.max.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

@ApiModel("用户注册对象")
public class UserRegisterDTO {

    @ApiModelProperty("用户名称")
    @Length(min = 2, max = 15, message = "用户名称长度在2-15个字符之间")
    private String username;
    @ApiModelProperty("登录名称(手机号)")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "登录名称格式不正确")
    private String loginName;
    @ApiModelProperty("密码")
    @Length(min = 6, max = 20, message = "密码长度在6-20个字符之间")
    @Pattern(regexp = "^(?=.[a-z])(?=.[A-Z])(?=.[0-9])[0-9a-zA-Z]{6,20}$", message = "密码格式不正确")
    private String pwd;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
}
